home *** CD-ROM | disk | FTP | other *** search
- /*
- * nntpcopy version 1.0
- *
- * ARexx script to copy a news article into uunews:NNTPSpoolDir
- * A unique filename is created before copying the article
- * Usage: nntpcopy <article>
- *
- * Written by David Jameson, 1994.
- */
-
- arg args
-
- /* Open RexxSupport library */
-
- if ~show('L', 'rexxsupport.library') then do
- if addlib('rexxsupport.library', 0, -30, 0) then
- say 'added rexxsupport.library'
- else do
- say 'failed to open rexxsupport.library'
- exit 10
- end
- end
-
- date = date()
- parse var date day month year
-
- /* Remove leading spaces from year */
- year = right(year,4)
-
- time = time()
- parse var time hour ':' min ':' sec
- filename = 'article.'||hour||'.'||min||'.'||sec||'.'||day||month||year
-
- if exists('uunews:NNTPSpoolDir/'||filename) then do
- say 'Error: temporary file already exists'
- exit 20
- end
-
- /* Copy file into NNTPSpoolDir */
-
- address command
- 'copy' args 'uunews:NNTPSpoolDir/'||filename||' >t:'||filename
- ret_val = statef('t:'||filename) /* major kludge... */
- parse var ret_val type size ignore
- if size ~= 0 then exit 10 /* copy failed */
- exit 0
-